
public class Main {
    
    public static int parseRegion(char c) {
        switch (c) {
            case 'A': return 10;
            case 'B': return 11;
            case 'C': return 12;
            case 'D': return 13;
            case 'E': return 14;
            case 'F': return 15;
            case 'G': return 16;
            case 'H': return 17;
            case 'I': return 34;
            case 'J': return 18;
            case 'K': return 19;
            case 'L': return 20;
            case 'M': return 21;
            case 'N': return 22;
            case 'O': return 35;
            case 'P': return 23;
            case 'Q': return 24;
            case 'R': return 25;
            case 'S': return 26;
            case 'T': return 27;
            case 'U': return 28;
            case 'V': return 29;
            case 'W': return 32;
            case 'X': return 30;
            case 'Y': return 31;
            case 'Z': return 33;
            default: return 0;
        }
    }
    
    public static boolean isValidID(String strID) {
        strID = strID.toUpperCase();
        int regionNumber = parseRegion(strID.charAt(0));
        int algoSum = (regionNumber % 10 * 9) + (regionNumber / 10);
        int strIndex = 1;
        for (int k=8; k>=1; k--) {
            algoSum += Integer.parseInt(strID.substring(strIndex, strIndex+1)) * k;
            strIndex++;
        }
        algoSum += Integer.parseInt(strID.substring(strIndex, strID.length()));
        return (algoSum % 10) == 0;
    }

    public static void main(String[] args) {
        String strID = "t112663836";
        System.out.println(strID);
        
        System.out.println(strID + ": " + isValidID(strID));
    }

}
